<!-- lekslist index -->
<?php $this->render('common/header'); ?>
	<div id="wsbox">
		<div class="search">
			<table>
				<tr>
					<td>Search by leks name</td>
					<td><input type="text" class="text" id="s-by-name" name="sLeksName"/></td>
					<td><button class="button" id="s-by-name-btn">&rarr;</button></td>
					<!--<td>&nbsp;|&nbsp;</td> -->
				</tr>
					<tr>
						<td>Search by value</td>
						<td><input type="text" class="text" id="s-by-val" name="sLeksVal"/></td>
						<td><button class="button" id="s-by-val-btn">&rarr;</button></td>
					</tr>
				</tr>
			</table>
		</div>
		<!--<div style="text-align: center;" class="marg-bot-5"> -->
			<div id="lang-filter" style="-moz-border-radius: 7px; width: 625px; background: #FAEBD7; padding: 3px; float: right; margin-top: -75;">
				<form action="index.php?cont=leks" method="post">
					<ul style="padding: 0px;">
						<li class="disp-inline" style="font-weight: bold; color: #999999;">You can choose specific language:</li>
						<li class="disp-inline"><input type="radio" name="filterLang" value="all" <?php echo empty($filterLang) ? 'checked="checked"' : ''; ?>/> All</li>
						<?php foreach ($dicts as $dict): ?>
							<li class="disp-inline"><input type="radio" name="filterLang" value="<?php echo $dict->name; ?>" <?php echo ($dict->name == $filterLang) ? 'checked="checked"' : ''; ?>/> <?php echo $dict->name; ?> </li>
						<?php endforeach; ?>
						<li class="disp-inline"><input type="submit" class="button" name="applyFilter" value="Apply"></li>
					</ul>
					<input type="hidden" id="hid-filter-lang" value="<?php echo empty($filterLang) ? '' : $filterLang; ?>" />
				</form>
			</div>
		<!-- </div> -->
		<!--
		<div class="center marg-bot-5">
			<a style="cursor: pointer;" onclick="javascript:window.open('index.php?cont=leks&amp;act=addleks','','width=1000,height=700,resizable=1,scrollbars=1','');"><img src="<?php echo Config::$imgDir . '/icoplus.gif' ?>" alt="add user" title="add new user" border="0" />&nbsp;Add new leks</a>
		</div>
		-->
		<!-- <div class="pager marg-bot-5">
			<a href="index.php?cont=leks&amp;page=<?php echo $prevPage; ?>">&larr; Here</a>&nbsp;[<?php echo $currPage ?>&nbsp;of&nbsp;<?php echo $totalPages; ?>]&nbsp;<a href="index.php?cont=leks&amp;page=<?php echo $nextPage; ?>">There &rarr;</a>
            <div class="nearest">
                <?php if(!empty($left)): ?>
                    <a  class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $firstPage; ?>">&larr;</a>
                    <?php foreach($left as $leftPage): ?>
                        <a  class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $leftPage; ?>"><?php echo $leftPage; ?></a>
                    <?php endforeach; ?>
                <?php endif; ?>
                ... <?php echo $currPage; ?> ...
                <?php if(!empty($right)): ?>
                    <?php foreach($right as $rightPage): ?>
                        <a class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $rightPage; ?>"><?php echo $rightPage; ?></a>
                    <?php endforeach; ?>
                    <a  class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $lastPage; ?>">&rarr;</a>
                <?php endif; ?>
            </div>
		</div> -->
		<table id="leks-table" style="margin-top: 10px;">
			<thead>
				<tr>
					<th>
						#
					</th>
					<th>
						Name
					</th>
					<th>
						Base value
					</th>
                    <th>
                        Context
                    </th>
					<th>
						Status
					</th>
					<th>
						Manage
					</th>
					<th>
						Action
					</th>
				</tr>
			</thead>
			<tbody>	
				<?php $i = 0; foreach ($leks as $leksem): ?>
					<tr <?php echo (!$leksem->isTranslated())? 'class="colored"' : 'class="colored-transl"' ?>>
						<td><?php echo ++$i; ?></td>
						<td><?php echo $leksem->name; ?></td>
						<td><?php echo $leksem->value; ?></td>
                        <td><?php echo (empty($leksem->context) ? 'no context' : $leksem->context); ?></td>
						<?php if($leksem->isTranslated()): ?>
							<td>translated</td>	
							<td><a style="cursor: pointer;" onclick="javascript:window.open('index.php?cont=leks&amp;act=view&amp;id=<?php echo $leksem->id; ?>','','width=800,height=500,resizable=1,scrollbars=1','');" class="view-trans">view translations</a>&nbsp;|&nbsp;<a style="cursor: pointer;" href="index.php?cont=leks&amp;act=translate&amp;id=<?php echo $leksem->id; ?>">translate</a></td>
						<?php else: ?>
							<td>not translated</td>
							<td><a style="cursor: pointer;" href="index.php?cont=leks&amp;act=translate&amp;id=<?php echo $leksem->id; ?>">translate</a></td>
						<?php endif; ?>
						<td>							
							<div style="min-width: 55px;">
								<a style="cursor: pointer;" onclick="javascript:window.open('index.php?cont=leks&amp;act=edit&amp;id=<?php echo $leksem->id; ?>','','width=1000,height=700,resizable=1,scrollbars=1','');" >&nbsp;<img src="<?php echo Config::$imgDir . '/edit.png'; ?>" alt="edit leksem" border="0" /></a> | <a onclick="confirmDeletionLeks('<?php echo $leksem->id; ?>');">&nbsp;<img src="<?php echo Config::$imgDir . '/delete.png'; ?>" alt="delete leksem" border="0" /></a>
							</div>
						</td>
					</tr>
				<?php endforeach; ?>
			</tbody>	
		</table>
		<!--
		<div class="center marg-top-5">
			<a style="cursor: pointer;" onclick="javascript:window.open('index.php?cont=leks&amp;act=addleks','','width=1000,height=700,resizable=1,scrollbars=1','');"><img src="<?php echo Config::$imgDir . '/icoplus.gif' ?>" alt="add user" title="add new user" border="0" />&nbsp;Add new leks</a>
		</div>
		-->
		<div class="pager">
			<a href="index.php?cont=leks&amp;page=<?php echo $prevPage; ?>">&larr; Here</a>&nbsp;[<?php echo $currPage ?>&nbsp;of&nbsp;<?php echo $totalPages; ?>]&nbsp;<a href="index.php?cont=leks&amp;page=<?php echo $nextPage; ?>">There &rarr;</a>
            <div class="nearest">
                <?php if(!empty($left)): ?>
                    <a  class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $firstPage; ?>">&larr;</a>
                    <?php foreach($left as $leftPage): ?>
                        <a  class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $leftPage; ?>"><?php echo $leftPage; ?></a>
                    <?php endforeach; ?>
                <?php endif; ?>
                ... <?php echo $currPage; ?> ...
                <?php if(!empty($right)): ?>
                    <?php foreach($right as $rightPage): ?>
                        <a class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $rightPage; ?>"><?php echo $rightPage; ?></a>
                    <?php endforeach; ?>
                    <a  class="nearest-pg" href="index.php?cont=leks&amp;page=<?php echo $lastPage; ?>">&rarr;</a>
                <?php endif; ?>
            </div>
		</div>
	</div>
<?php $this->render('common/footer'); ?>